/*
 * tracking_settings.h
 *
 *  Created on: 16.06.2011
 *      Author: nick
 */

#ifndef TRACKING_SETTINGS_H_
#define TRACKING_SETTINGS_H_


#include <cxcore.h>
#include <cv.h>

//if defined - uses correct the ROS-OpenCV Color channels (RGB instead of BGR)
#define ROS_BUILD

//show the images as opencv highgui popups
#define SHOW_IMGS

//if defined - the YCrCb color space is used. Otherwise RGB is used. RGB is better.
//TODO: atm broken - always use YCRCB!
#define YCRCB

//horizontal resolution of the processed image
#define X_WIDTH 640
//TODO: defines so anpassen dass die aufloesung nur an einer stelle eingestellt werden muss
// Defines zum Bild beschneiden
#define DTOP1		130
#define DTOP2		200
#define DBOTTOM1	130
#define DBOTTOM2	200
#define DLEFT		300
#define DRIGHT		300

// Scalar( RED , GREEN , BLUE )
#ifdef ROS_BUILD
static const cv::Scalar green = cv::Scalar(50,255,50);
static const cv::Scalar blue = cv::Scalar(0,0,255);
#else
// Scalar( BLUE , GREEN , RED )
static const cv::Scalar green = cv::Scalar(50,255,50);
static const cv::Scalar blue = cv::Scalar(255,0,0);
#endif
static const cv::Scalar white = cv::Scalar(255,255,255);

/*
 * FILTERSETTINGS
 */
//maximum roundness value a mark is allowed to have to be processed
#define ROUNDNESS_UPPER_LIMIT 30
//the segmentation threshold for the red-channel image
#define RED_SEGMENTATION_THRESH 155
//all irrelevant areas of the picture get blacked out
#define FLOORMASK

/*
 * TRACKING - BONUS VALUES
 */

// if the sum of the bonus values >= this limit, two marks are considered the same
#define SIMILARITY_LIMIT 70

// are both Marks on the same side of the picture?
#define ORIENTATION_BONUS 40;
// is the mark growing? (aka it's getting closer because we move towards it)
#define AREA_BONUS 10;
// is the mark getting rounder as we move closer?
#define ROUNDNESS_BONUS 10;
// does the mark move in the same direction it moved in the last increment?
#define VECTOR_BONUS 20;

/*
 * TRACKING - ERROR MARGINS
 */
//TODO: @HOLL hier drehen falls die marks nicht getrackt werden. Je niedriger die FPS, desto hoeher der wert
//! maximum X difference a mark is allowed to move during one frame
#define MAX_XDIFF 20
//! error margin factor for the roundness
#define ROUNDNESS_DELTA 0.1
// error margin factor for the area
#define AREA_DELTA 0.1
//! number of times a mark is allowed to miss updates before its reported as result or deleted
#define UPDATES_ALLOWED_TO_MISS 4
//! width of the area that is considered border.
#define BORDER_AREA X_WIDTH/8

#endif /* TRACKING_SETTINGS_H_ */
